<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
*{margin:0;padding:0;}
#ul{ width:100px; background:#ccc; border:1px solid black; position:absolute; list-style:none; display:none;}
</style>
<script>
window.oncontextmenu=function(e){
	var ev=e||event;
	var ul=document.getElementById('ul');
	var scrollL=document.documentElement.scrollLeft||document.body.scrollLeft;
	var scrollT=document.documentElement.scrollTop||document.body.scrollTop;
	ul.style.display='block';
	ul.style.left=ev.clientX+scrollL+'px';
	ul.style.top=ev.clientY+scrollL+'px';
	return false;	
};
document.onclick=function(){
	var ul=document.getElementById('ul');
	ul.style.display='none';
};
</script>
</head>

<body>
<ul id="ul">
	<li>回到首页</li>
	<li>回到首页</li>
	<li>回到首页</li>
	<li>回到首页</li>
</ul>
</body>
</html>
